package org.chen;

import org.chen.common.utils.SnowflakeIdGenerator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;

import javax.annotation.PostConstruct;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableAsync
public class VideoStarter {
    public static void main(String[] args) {
        SpringApplication.run(VideoStarter.class, args);
    }

    @PostConstruct
    public void init() {
        // workerId 和 datacenterId 根据实际部署情况配置
        SnowflakeIdGenerator.init(1, 1);
    }
}
